
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../commons/taglibs.jsp"%>

<c:if test="${not empty errorMsg}">
	<div class="goods_infr">
		<div style="color: red; font-size: 16px; margin: 10px">${errorMsg }</div>
	</div>
</c:if>
<div class="select_photo_tool">
	<!-- <label>个人相册：</label> -->
	<form id="uploadForm" method="post" enctype="multipart/form-data" action="uploadFile">

		<input id="albumId" name="albumId" type="hidden" style="display: none;" />
		<input id="fileId" multiple name="file" type="file" style="display: none;" />
		<select name="albumId">
			<option value="">默认相册(${page.totalItems })</option>
		</select>
		<!-- 	<button type="button" id="albumBtn" style="background:#2f9a8c;margin-left:10px">
		<span>相册管理</span>
	</button> -->
		<button type="button" id="uploadBtn" style="background: #ff3c3c; margin-left: 10px">
			<span>上传图片</span>
		</button>
	</form>
</div>

<div class="select_photo_content">
	<c:if test="${empty page.result}">
		<div class="goods_infr">
			<div style="color: red; font-size: 16px; margin: 10px">没找到相关记录！</div>
		</div>
	</c:if>

	<ul class="hover-ul-a" id="layer-photos">
		<c:forEach items="${page.result}" var="item">
			<li>
				<img onclick="selectPhoto.usePhoto(this)" layer-src="${uploadImageBase}/${item.path}/${item.name}" src="${uploadImageBase}/${item.path}/${item.name}" title="图片">
			</li>
		</c:forEach>
	</ul>
</div>
<div style="clear: both;"></div>
<br>
<div class="list_page">
	<!--paging-->
	<div class="list_page_paging">
		<ul>
			<c:choose>
				<c:when test="${page.pageNo>1}">
					<li>
						<a href="javascript:reLoadIconListPage(${page.prePage})">上一页</a>
					</li>
				</c:when>
				<c:otherwise>
					<li style="display: none">
						<a>上一页</a>
					</li>
				</c:otherwise>
			</c:choose>
			<c:choose>
				<c:when test="${page.pageNo<page.totalPages}">
					<li>
						<a href="javascript:reLoadIconListPage(${page.nextPage})">下一页</a>
					</li>
				</c:when>
				<c:otherwise>
					<li style="display: none">
						<a>上一页</a>
					</li>
				</c:otherwise>
			</c:choose>
		</ul>
	</div>
</div>
<script type="text/javascript" src="${vendorsBase}/ueditor/photo_select.js?v=${version}"></script>
<script type="text/javascript">
	function reLoadIconListPage(page) {
		$("#selectPhoto").load("photo_select" + "?albumId=" + parent.albumId, "pageNo=" + page, function(res, status, xhr) {
		});
	}
</script>